﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TongHopBCTuan2014
{
    public partial class setData : Form
    {
        infoXML info;
        public setData()
        {
            InitializeComponent();
            info = new infoXML();
            reName.Text = "Báo cáo tuần " + "<font color=\"#B02B2C\">" + info.name + "</font>";
            //<b><font size="+6"><i>Dev</i><font color="#B02B2C">Components</font></font></b>


        }

        private void setData_Load(object sender, EventArgs e)
        {
            processXML setdata = new processXML();
            loadDataForName(setdata.getdata("tendanhmuc.xml"));

            //-------------------------- set data for combobox-----------------------------------
            dlieuhuyen dlhuyen = new dlieuhuyen();
            List<huyen> lhuyen = dlhuyen.listHuyen();
            MessageBox.Show(lhuyen.Count.ToString());
            cbbDonVi.DataSource = lhuyen;
            cbbDonVi.DisplayMember = "TenHuyen";
            cbbDonVi.ValueMember = "MaHuyen";

        }

        private void reName_Click(object sender, EventArgs e)
        {

        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }
        private void loadDataForName( data data)
        {
            //-------------------------   A   ----------------------------
            lbA.Text = data.A;
            lbr1.Text = data.R1;
            lbr2.Text = data.R2;
            lbr3.Text = data.R3;
            lbr4.Text = data.R4;
            lbr5.Text = data.R5;
            lbr6.Text = data.R6;
            lbr7.Text = data.R7;
            lbr8.Text = data.R8;
            lbr9.Text = data.R9;
            lbr10.Text = data.R10;
            lbr11.Text = data.R11;
            lbr12.Text = data.R12;
            lbr13.Text = data.R13;
            lbr14.Text = data.R14;
            lbr15.Text = data.R15;
            lbr16.Text = data.R16;
            lbr17.Text = data.R17;
            lbr18.Text = data.R18;
            lbr19.Text = data.R19;
            lbr20.Text = data.R20;
            lbr21.Text = data.R21;

            tbr1.WatermarkText = data.R1;
            tbr2.WatermarkText = data.R2;
            tbr3.WatermarkText = data.R3;
            tbr4.WatermarkText = data.R4;
            tbr5.WatermarkText = data.R5;
            tbr6.WatermarkText = data.R6;
            tbr7.WatermarkText = data.R7;
            tbr8.WatermarkText = data.R8;
            tbr9.WatermarkText = data.R9;
            tbr10.WatermarkText = data.R10;
            tbr11.WatermarkText = data.R11;
            tbr12.WatermarkText = data.R12;
            tbr13.WatermarkText = data.R13;
            tbr14.WatermarkText = data.R14;
            tbr15.WatermarkText = data.R15;
            tbr16.WatermarkText = data.R16;
            tbr17.WatermarkText = data.R17;
            tbr18.WatermarkText = data.R18;
            tbr19.WatermarkText = data.R19;
            tbr20.WatermarkText = data.R20;
            tbr21.WatermarkText = data.R21;



            //-------------------------   B   ----------------------------
            lbB.Text = data.B;
            lbr22.Text = data.R22;
            lbr23.Text = data.R23;
            lbr24.Text = data.R24;
            lbr25.Text = data.R25;
            lbr26.Text = data.R26;
            lbr27.Text = data.R27;
            lbr28.Text = data.R28;
            lbr29.Text = data.R29;
            lbr30.Text = data.R30;
            lbr31.Text = data.R31;
            lbr32.Text = data.R32;
            lbr33.Text = data.R33;
            lbr34.Text = data.R34;
            lbr35.Text = data.R35;
            lbr36.Text = data.R36;



            tbr22.WatermarkText = data.R22;
            tbr23.WatermarkText = data.R23;
            tbr24.WatermarkText = data.R24;
            tbr25.WatermarkText = data.R25;
            tbr26.WatermarkText = data.R26;
            tbr27.WatermarkText = data.R27;
            tbr28.WatermarkText = data.R28;
            tbr29.WatermarkText = data.R29;
            tbr30.WatermarkText = data.R30;
            tbr31.WatermarkText = data.R31;
            tbr32.WatermarkText = data.R32;
            tbr33.WatermarkText = data.R33;
            tbr34.WatermarkText = data.R34;
            tbr35.WatermarkText = data.R35;
            tbr36.WatermarkText = data.R36;
            //-------------------------   C   ----------------------------

            lbr37.Text = data.R37;
            lbr38.Text = data.R38;
            lbr39.Text = data.R39;
            lbr40.Text = data.R40;
            lbr41.Text = data.R41;
            lbr42.Text = data.R42;
        }

        private void textBoxX11_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBoxX24_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
